home *** CD-ROM | disk | FTP | other *** search
/ Aminet 6 / Aminet 6 - June 1995.iso / Aminet / gfx / 3d / irit50src.lha / irit5 / include / miscattr.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-09-22  |  2.4 KB  |  80 lines

  1. /*****************************************************************************
  2. * Setting attributes for objects.                         *
  3. *                                         *
  4. * Written by:  Gershon Elber                Ver 0.2, Mar. 1990   *
  5. *****************************************************************************/
  6.  
  7. #ifndef MISCATTR_H
  8. #define MISCATTR_H
  9.  
  10. #include "irit_sm.h"
  11.  
  12. typedef enum {
  13.     IP_ATTR_NONE,
  14.     IP_ATTR_INT,
  15.     IP_ATTR_REAL,
  16.     IP_ATTR_STR,
  17.     IP_ATTR_OBJ,
  18.     IP_ATTR_PTR
  19. } IPAttributeType;
  20.  
  21. #define IP_ATTR_BAD_INT        -32767
  22. #define IP_ATTR_BAD_REAL    1e30
  23. #define IP_ATTR_NO_COLOR    999
  24.  
  25. /*****************************************************************************
  26. * Attributes - an attribute has a name and can be one of the following:         *
  27. * an integer, real, string, or a pointer to an Object.                 *
  28. *****************************************************************************/
  29. typedef struct IPAttributeStruct {
  30.     struct IPAttributeStruct *Pnext;
  31.     char *Name;
  32.     IPAttributeType Type;
  33.     union {
  34.     char *Str;
  35.        int I;
  36.     RealType R;
  37.     struct IPObjectStruct *PObj;
  38.     VoidPtr Ptr;
  39.     } U;
  40. } IPAttributeStruct;
  41.  
  42. #if defined(__cplusplus) || defined(c_plusplus)
  43. extern "C" {
  44. #endif
  45.  
  46. void AttrSetIntAttrib(IPAttributeStruct **Attrs, char *Name, int Data);
  47. int AttrGetIntAttrib(IPAttributeStruct *Attrs, char *Name);
  48.  
  49. void AttrSetRealAttrib(IPAttributeStruct **Attrs, char *Name, RealType Data);
  50. RealType AttrGetRealAttrib(IPAttributeStruct *Attrs, char *Name);
  51.  
  52. void AttrSetPtrAttrib(IPAttributeStruct **Attrs, char *Name, VoidPtr Data);
  53. VoidPtr AttrGetPtrAttrib(IPAttributeStruct *Attrs, char *Name);
  54.  
  55. void AttrSetStrAttrib(IPAttributeStruct **Attrs, char *Name, char *Data);
  56. char *AttrGetStrAttrib(IPAttributeStruct *Attrs, char *Name);
  57.  
  58. IPAttributeStruct *AttrTraceAttributes(IPAttributeStruct *TraceAttrs,
  59.                        IPAttributeStruct *FirstAttrs);
  60. char *Attr2String(IPAttributeStruct *Attr);
  61.  
  62. void AttrResetAttributes(IPAttributeStruct **Attrs);
  63.  
  64. void AttrFreeOneAttribute(IPAttributeStruct **Attrs, char *Name);
  65. void AttrFreeAttributes(IPAttributeStruct **Attrs);
  66.  
  67. IPAttributeStruct *AttrFindAttribute(IPAttributeStruct *Attrs, char *Name);
  68.  
  69. IPAttributeStruct *_AttrMallocAttribute(char *Name, IPAttributeType Type);
  70. void _AttrFreeAttributeData(IPAttributeStruct *Attr);
  71.  
  72. IPAttributeStruct *AttrCopyAttributes(IPAttributeStruct *Src);
  73. IPAttributeStruct *AttrCopyOneAttribute(IPAttributeStruct *Src);
  74.  
  75. #if defined(__cplusplus) || defined(c_plusplus)
  76. }
  77. #endif
  78.  
  79. #endif /* MISCATTR_H */
  80.